export default {
  computed: {
    // 表格中列字段
    columns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "类别编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "类别名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "category",
          title: {
            "zh-CN": "所属分类",
            "en-US": "category",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
          render: (h, params) => {
            return h(
              "div",
              {},
              this.getOptionValue(this.categoryOptions, params.row.category)
            );
          },
        },
        {
          key: "brevity",
          title: {
            "zh-CN": "类别简码",
            "en-US": "brevity",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
      ];
    },
    // form中列字段
    formColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "类别编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "类别名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "brevity",
          title: {
            "zh-CN": "类别简码",
            "en-US": "brevity",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "category",
          title: {
            "zh-CN": "所属分类",
            "en-US": "category",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "select", options: this.categoryOptions },
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
      ];
    },
    queryFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "类别编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "类别名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "类别编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "类别名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    lang() {
      return {
        "en-US": {
          cancel: "cancel",
          confirmDelete: "confirm delete?",
        },
        "zh-CN": {
          cancel: "取消",
          confirmDelete: "确认删除？",
        },
      }[this.G_Locale];
    },
  },
};
